﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EscapeChar {
    //常量
    public class ConstTest {
        class SampleClass {
            public int x;
            public int y;
            //常量是使用 const 关键字来定义的
            public const int c1 = 5;
            public const int c2 = c1 + 5;

            public const string str = "123";

            public SampleClass(int p1, int p2) {
                x = p1;
                y = p2;
            }
        }

        static void Main() {
            SampleClass mC = new SampleClass(11, 22);
            Console.WriteLine("x = {0}, y = {1},str = {2}", mC.x, mC.y, SampleClass.str);
            Console.WriteLine("c1 = {0}, c2 = {1}",SampleClass.c1, SampleClass.c2);
            Console.ReadLine();
        }
    }
}
